<?php if(!defined('IN_FIRADIO')) {header('HTTP/1.1 403 Forbidden');exit('<h1>Access Denied</h1>');}?>
<?php $GLOBALS['script'][] = function() {?><script>
vue.data.apidata = {};
vue.data.disabled = 0;
vue.data.form.wan_port = '';
vue.methods.submit_list = function () {
    const form = {};
    this.ApiPost('/panel/yun/nthost/ticket_thread_list.php', form).then(function (data) {
        vue.data.apidata = data.data;
    }, function (data) {
        console.log('reject:', data);
    }).catch(function (reason) {
        console.log('catch:', reason);
    })
};
vue.mounted = function () {
    vue.methods.submit_list();
};
</script><?php }?>

<div class="row">
    <div class="col-xs-12 col-sm-8 col-md-6 col-lg-6">
        <div class="box box-info">
            <table id="example1" class="table table-bordered table-striped dataTable" role="grid"
            v-if="apidata.rows&&apidata.rows.length>0"
            aria-describedby="example1_info">
                <thead>
                    <tr role="row">
                        <th class="sorting" tabindex="0" rowspan="1" colspan="1" aria-label="">主机名</th>
                        <th class="sorting" tabindex="0" rowspan="1" colspan="1" aria-label="">用户名</th>
                        <th class="sorting" tabindex="0" rowspan="1" colspan="1" aria-label="">您的问题</th>
                        <th class="sorting" tabindex="0" rowspan="1" colspan="1" aria-label="">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr role="row" class="odd" v-for="row in apidata.rows">
                      <td>{{row['host_name']}}</td>
                      <td>{{row['username']}}</td>
                      <td>{{row['subject']}}</td>
                      <td>-</td>
                    </tr>
                </tbody>
            </table>
            <div v-else>
                您尚未发起过任何【工单】，请先到【我的远程主机】发起提问
            </div>
        </div>
    </div>
</div>
